<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
					xmlns:controls="clr-namespace:Monitorian.Core.Views.Controls"
					xmlns:converters="clr-namespace:Monitorian.Core.Views.Converters">

	<!-- Theme (Dark theme) -->
	<Color x:Key="App.ForegroundColor">White</Color>
	<Color x:Key="App.ShadowColor">LightGray</Color>
	<Color x:Key="App.LineColor">#FF808080</Color>
	<Color x:Key="App.TargetColor">LightGray</Color>
	<Color x:Key="App.OverlayColor">#48000000</Color>

	<Color x:Key="App.Background.Accent.StaticColor">#FF2982CC</Color>
	<Color x:Key="App.Background.Accent.MouseOverColor">#FF5CA4DE</Color>
	<Color x:Key="App.Background.Accent.PressedColor">#FF5CA4DE</Color>

	<SolidColorBrush x:Key="App.Foreground" Color="{DynamicResource App.ForegroundColor}"/>
	<SolidColorBrush x:Key="App.Foreground.Shadow" Color="{DynamicResource App.ShadowColor}"/>
	<SolidColorBrush x:Key="App.Foreground.Dusk" Color="#FFACACAC"/>
	<SolidColorBrush x:Key="App.Foreground.Invalid" Color="Red"/>

	<SolidColorBrush x:Key="App.Border.Outline" Color="{DynamicResource App.LineColor}"/>
	<SolidColorBrush x:Key="App.Background.Plain" Color="#FF1F1F1F"/>
	<SolidColorBrush x:Key="App.Background.Translucent" Color="#D3161616"/>

	<Color x:Key="Icon.Foreground.NormalColor">#FF808080</Color>
	<Color x:Key="Icon.Background.MouseOverColor">#33FFFFFF</Color>
	<Color x:Key="Icon.Background.PressedColor">#55FFFFFF</Color>

	<SolidColorBrush x:Key="Icon.Foreground.Normal" Color="{DynamicResource Icon.Foreground.NormalColor}"/>

	<SolidColorBrush x:Key="Menu.Separator" Color="{DynamicResource App.LineColor}"/>

	<SolidColorBrush x:Key="Menu.Item.Background.MouseOver" Color="#FF5F5F5F"/>

	<Color x:Key="Text.Foreground.NormalColor">White</Color>
	<Color x:Key="Text.Foreground.DisabledColor">#FFC8C8C8</Color>
	<Color x:Key="Text.Background.NormalColor">#BB848484</Color>
	<Color x:Key="Text.Background.MouseOverColor">#BB969696</Color>
	<Color x:Key="Text.Background.PressedColor">#BBA8A8A8</Color>

	<SolidColorBrush x:Key="ScrollBar.Thumb.Normal" Color="#33BCBCBC"/>
	<SolidColorBrush x:Key="ScrollBar.Thumb.MouseOver" Color="#33EFEFEF"/>
	<SolidColorBrush x:Key="ScrollBar.Thumb.Pressed" Color="#33EFEFEF"/>

	<!-- Converters -->
	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverterKey"/>
	<converters:BooleanToVisibilityTurnConverter x:Key="BooleanToVisibilityTurnConverterKey"/>
	<converters:VisibilityToBooleanFilterConverter x:Key="VisibilityToBooleanFilterConverterKey"/>
	<converters:BooleanInverseConverter x:Key="BooleanInverseConverterKey"/>
	<converters:VisibilityInverseConverter x:Key="VisibilityInverseConverterKey"/>
	<converters:ObjectToVisibilityConverter x:Key="ObjectToVisibilityConverterKey"/>

	<!-- Menu separator -->
	<Style x:Key="MenuSeparatorStyle" TargetType="{x:Type Separator}">
		<Setter Property="Margin" Value="8,4"/>
		<Setter Property="Background" Value="{DynamicResource Menu.Separator}"/>
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="UseLayoutRounding" Value="True"/>
		<Setter Property="controls:FrameworkElementSize.ConsistentHeight" Value="1"/>
	</Style>

	<!-- Menu item -->
	<Style x:Key="MenuItemStyle" TargetType="{x:Type ContentControl}">
		<Setter Property="Focusable" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ContentControl}">
					<Grid x:Name="body"
						  Background="Transparent"
						  SnapsToDevicePixels="True" UseLayoutRounding="True">
						<ContentPresenter x:Name="presenter"
										  Margin="{TemplateBinding Padding}"
										  Content="{TemplateBinding Content}"
										  ContentTemplate="{TemplateBinding ContentTemplate}"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="FocusManager.FocusedElement" TargetName="presenter" Value="{Binding ElementName=presenter, Path=Content}"/>
						</Trigger>
						<Trigger Property="IsKeyboardFocusWithin" Value="True">
							<Setter Property="Background" TargetName="body" Value="{DynamicResource Menu.Item.Background.MouseOver}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Check Button -->
	<Style x:Key="CheckButtonItemStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="13"/>
		<Setter Property="controls:FlowElement.Visibility" Value="Collapsed"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Grid Margin="{TemplateBinding Padding}"
						  Background="{TemplateBinding Background}"
						  SnapsToDevicePixels="True" UseLayoutRounding="True">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<Grid Grid.Column="0"
							  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
							<Polyline x:Name="checkMark"
									  Margin="3"
									  Points="0,5 4,9 12,0" Stretch="Uniform"
									  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"
									  Opacity="0"/>
						</Grid>
						<ContentPresenter Grid.Column="1"
										  Margin="3" HorizontalAlignment="Left" VerticalAlignment="Center"
										  Focusable="False"/>
						<Grid Grid.Column="2"
							  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}"
							  Visibility="{TemplateBinding controls:FlowElement.Visibility}"/>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="True">
							<Setter Property="Opacity" TargetName="checkMark" Value="1"/>
						</Trigger>
						<Trigger Property="IsChecked" Value="{x:Null}">
							<Setter Property="Opacity" TargetName="checkMark" Value="0"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Plain Button -->
	<Style x:Key="PlainButtonItemStyle" TargetType="{x:Type ContentControl}">
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="13"/>
		<Setter Property="controls:FlowElement.Visibility" Value="Collapsed"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ContentControl}">
					<Grid Margin="{TemplateBinding Padding}"
						  Background="{TemplateBinding Background}"
						  SnapsToDevicePixels="True" UseLayoutRounding="True">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
							<ColumnDefinition Width="Auto"/>
						</Grid.ColumnDefinitions>
						<Grid Grid.Column="0"
							  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}"/>
						<ContentPresenter Grid.Column="1"
										  Margin="3" HorizontalAlignment="Left" VerticalAlignment="Center"
										  Focusable="False"/>
						<Grid Grid.Column="2"
							  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}"
							  Visibility="{TemplateBinding controls:FlowElement.Visibility}"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Close Button -->
	<Style x:Key="CloseButtonItemStyle" TargetType="{x:Type ContentControl}">
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="14"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ContentControl}">
					<Grid Margin="{TemplateBinding Padding}"
						  Background="{TemplateBinding Background}"
						  SnapsToDevicePixels="True" UseLayoutRounding="True">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto"/>
							<ColumnDefinition Width="*"/>
						</Grid.ColumnDefinitions>
						<Grid Grid.Column="0"
							  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
							<Path Margin="3"
								  Stretch="Uniform"
								  Stroke="{TemplateBinding Foreground}" StrokeThickness="1">
								<Path.Data>
									<GeometryGroup>
										<LineGeometry StartPoint="0,0" EndPoint="1,1"/>
										<LineGeometry StartPoint="0,1" EndPoint="1,0"/>
									</GeometryGroup>
								</Path.Data>
							</Path>
						</Grid>
						<ContentPresenter Grid.Column="1"
										  Margin="3" HorizontalAlignment="Left" VerticalAlignment="Center"
										  Focusable="False"/>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Multi Button -->
	<Style x:Key="MultiButtonItemStyle" TargetType="{x:Type controls:MultiToggleButton}">
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="13"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type controls:MultiToggleButton}">
					<Grid Margin="{TemplateBinding Padding}"
						  Background="{TemplateBinding Background}"
						  SnapsToDevicePixels="True" UseLayoutRounding="True">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Grid Grid.Row="0"
							  x:Name="upperGrid">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<Grid Grid.Column="0"
								  x:Name="checkGrid"
								  Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
								<Polyline x:Name="checkMark"
										  Margin="3"
										  Points="0,5 4,9 12,0" Stretch="Uniform"
										  Stroke="{TemplateBinding Foreground}" StrokeThickness="1"
										  Opacity="0"/>
							</Grid>
							<ContentPresenter Grid.Column="1"
											  Margin="3" HorizontalAlignment="Left" VerticalAlignment="Center"
											  Focusable="False"/>
						</Grid>
						<!-- Upper and lower grids are divided to set the width of lower grid. -->
						<Grid Grid.Row="1"
							  x:Name="lowerGrid"
							  Width="{Binding ElementName=upperGrid, Path=ActualWidth}">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto"/>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Grid Grid.Column="0"
								  Width="{Binding ElementName=checkGrid, Path=ActualHeight}"/>
							<ContentPresenter Grid.Column="1"
											  Content="{TemplateBinding SubContent}"
											  Margin="3,2,3,6"
											  Focusable="False"/>
							<Grid Grid.Column="2"
								  Width="{Binding ElementName=checkGrid, Path=ActualHeight}"/>
						</Grid>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="True">
							<Setter Property="Opacity" TargetName="checkMark" Value="1"/>
						</Trigger>
						<Trigger Property="IsChecked" Value="{x:Null}">
							<Setter Property="Opacity" TargetName="checkMark" Value="0"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Plain TextElement -->
	<Style x:Key="PlainTextStyle" TargetType="{x:Type FrameworkElement}">
		<Setter Property="TextElement.Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="TextElement.FontSize" Value="12"/>
	</Style>

	<!-- Invalid TextElement -->
	<Style x:Key="InvalidTextStyle" TargetType="{x:Type FrameworkElement}" BasedOn="{StaticResource PlainTextStyle}">
		<Setter Property="TextElement.Foreground" Value="{StaticResource App.Foreground.Invalid}"/>
	</Style>

	<!-- Name TextBox -->
	<Style x:Key="NameTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="CaretBrush" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="14"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Border x:Name="border"
							BorderBrush="{DynamicResource App.Border.Outline}" BorderThickness="1"
							Background="{DynamicResource App.Background.Plain}"
							SnapsToDevicePixels="True">
						<ScrollViewer x:Name="PART_ContentHost"
									  VerticalScrollBarVisibility="Hidden"
									  Focusable="False"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsReadOnly" Value="True">
							<Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
							<Setter Property="Background" TargetName="border" Value="Transparent"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Identity TextBox -->
	<Style x:Key="IdentityTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="CaretBrush" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="10"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Border x:Name="border"
							BorderBrush="{DynamicResource App.Border.Outline}" BorderThickness="1"
							Background="{DynamicResource App.Background.Plain}"
							SnapsToDevicePixels="True">
						<ScrollViewer x:Name="PART_ContentHost"
									  VerticalScrollBarVisibility="Hidden"
									  Focusable="False"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsFocused" Value="False">
							<Setter Property="BorderBrush" TargetName="border" Value="Transparent"/>
							<Setter Property="Background" TargetName="border" Value="Transparent"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Plain TextBox -->
	<Style x:Key="PlainTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
		<Setter Property="Foreground" Value="{StaticResource App.Foreground}"/>
		<Setter Property="CaretBrush" Value="{StaticResource App.Foreground}"/>
		<Setter Property="FontSize" Value="12"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Border x:Name="border"
							BorderBrush="{DynamicResource App.Border.Outline}" BorderThickness="1"
							Background="{DynamicResource App.Background.Plain}"
							SnapsToDevicePixels="True">
						<ScrollViewer x:Name="PART_ContentHost"
									  VerticalScrollBarVisibility="Hidden"
									  Focusable="False"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsReadOnly" Value="True">
							<Setter Property="Foreground" Value="{DynamicResource App.Foreground.Dusk}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- Plain ScrollBar -->
	<Style x:Key="ScrollBarTrackButton" TargetType="{x:Type RepeatButton}">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="Focusable" Value="False"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type RepeatButton}">
					<Rectangle Width="{TemplateBinding Width}"
							   Height="{TemplateBinding Height}"
							   Fill="Transparent"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ScrollBarTrackThumb" TargetType="{x:Type Thumb}">
		<Setter Property="OverridesDefaultStyle" Value="True"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Thumb}">
					<Rectangle x:Name="rectangle"
							   Width="{TemplateBinding Width}"
							   Height="{TemplateBinding Height}"
							   Fill="{StaticResource ScrollBar.Thumb.Normal}"
							   SnapsToDevicePixels="True" UseLayoutRounding="True"/>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter TargetName="rectangle" Property="Fill" Value="{StaticResource ScrollBar.Thumb.MouseOver}"/>
						</Trigger>
						<Trigger Property="IsDragging" Value="True">
							<Setter TargetName="rectangle" Property="Fill" Value="{StaticResource ScrollBar.Thumb.Pressed}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="PlainScrollBarStyle" TargetType="{x:Type ScrollBar}">
		<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
		<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
		<Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
		<Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ScrollBar}">
					<Grid SnapsToDevicePixels="True">
						<Border Background="{TemplateBinding Background}"/>
						<Track x:Name="PART_Track"
							   IsDirectionReversed="True"
							   IsEnabled="{TemplateBinding IsMouseOver}">
							<Track.DecreaseRepeatButton>
								<RepeatButton Style="{StaticResource ScrollBarTrackButton}"
											  Command="{x:Static ScrollBar.PageUpCommand}"/>
							</Track.DecreaseRepeatButton>
							<Track.IncreaseRepeatButton>
								<RepeatButton Style="{StaticResource ScrollBarTrackButton}"
											  Command="{x:Static ScrollBar.PageDownCommand}"/>
							</Track.IncreaseRepeatButton>
							<Track.Thumb>
								<Thumb Style="{StaticResource ScrollBarTrackThumb}"/>
							</Track.Thumb>
						</Track>
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>